package com.javafactroy.kunlong.client.feign.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;

    private PageInfoDto param;

    public BaseModel() {
        param = new PageInfoDto();
    }

    public void fields2Col() {
        param.fields2Col();

    }

    /*
     * @params field
     * @params sort :  asc or desc
     * */
    public BaseModel orderBy(String field, String sort) {
        param.orderBy(field, sort);
        return this;
    }

    public void orderBy(String field) {
        param.orderBy(field);
    }


    public void startPage() {
        param.startPage();

    }

    public void startPageOrder() {
        param.startPageOrder();
    }

    public void startOrder() {
        param.startOrder();
    }

    public BaseModel between(String field, Date start, Date end) {
        param.between(field, start, end);
        return this;
    }

    public BaseModel between(String field, Date date) {
        param.between(field, date);
        return this;
    }

    public BaseModel betweenDate(String field, String start, String end) {
        param.betweenDate(field, start, end);
        return this;
    }


    public BaseModel between(String field, String start, String end) {
        param.between(field, start, end);
        return this;
    }

    public BaseModel between(String field, Integer start, Integer end) {
        param.between(field, start, end);
        return this;
    }

    public BaseModel between(String field, String start) {
        param.between(field, start);
        return this;
    }

    public BaseModel like(String field, String value) {
        param.like(field, value);
        return this;
    }

    public BaseModel in(String field, String value) {
        getParam().in(field, value);
        return this;
    }

    //=
    public BaseModel eq(String field, Object value) {
        param.eq(field, value);
        return this;
    }

    //<
    public BaseModel lt(String field, Object value) {
        param.lt(field, value);
        return this;
    }

    //>
    public BaseModel gt(String field, Object value) {
        param.gt(field, value);
        return this;
    }

    //<=
    public BaseModel le(String field, Object value) {
        param.le(field, value);
        return this;
    }

    //>=
    public BaseModel ge(String field, Object value) {
        param.ge(field, value);
        return this;
    }


    public BaseModel notBetween(String field, Date date) {
        param.notBetween(field, date);
        return this;
    }

    public BaseModel notBetween(String field, String s) {
        param.notBetween(field, s);
        return this;
    }

    public BaseModel notBetween(String field, String s, String e) {
        param.notBetween(field, s, e);
        return this;
    }

    public BaseModel notBetween(String field, Date start, Date end) {
        param.notBetween(field, start, end);
        return this;
    }

    public BaseModel notLike(String field, String value) {
        param.notLike(field, value);
        return this;
    }

    public BaseModel notIn(String field, String value) {
        param.notIn(field, value);
        return this;
    }

    public BaseModel notEq(String field, String value) {
        param.notEq(field, value);
        return this;
    }

}
